<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/common/taglibs.jsp"%>
<LINK href="${ctx}/styles/style.css" type='text/css' rel='stylesheet'>
<style type="text/css">
.title{
	width:360px;
	padding-top:5px;
	text-align: left;
	white-space:nowrap;
	word-break:keep-all;
	overflow:hidden;
	text-overflow:ellipsis;
	cursor: pointer;
}
</style>
<title></title>
</head>
<body>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr><td>
  	<iframe width="100%" frameborder="0" scrolling="no" src="${ctx}/pages/center_top.jsp" height="90"></iframe>
  </td></tr>
</table>
<form id="schForm" action="${ctx}/search/index.do" method="post" style="margin: 0; padding: 0;">
<table width="1000" border="0" align="center" class="yellow_border4">
<tr>
  <td height="28" style="vertical-align: middle">
    &nbsp;&nbsp;
    <img src="${ctx}/images/longtian/icon_tt.gif" width="14" height="15"/>&nbsp;
    <span style="font-weight: bold; font-size: 14px; color:red">关键字</span>：
    <s:textfield id="bkName" name="bkName" cssStyle="width:200px" />
    &nbsp;&nbsp;<a href="javascript:searchBook()"><img src="${ctx}/images/icons/zoom.gif"/>搜索</a>
    &nbsp;&nbsp;<a href="${ctx}/search/adsearch.do"><b>高级搜索</b></a>
  </td>
</tr>
</table>
</form>
<br>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
	<td width="300" valign="bottom" align="center">
		<script type="text/javascript">
			function lovestory(element,url,width,height,images,links,texts){
				var str = '';
				str += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,9,0" width="'+ width +'" height="'+ height +'">';
				str += '<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+url+'"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">';
				str += '<param name="menu" value="false"><param name=wmode value="opaque">';
				str += '<param name="FlashVars" value="pics='+images+'&amp;links='+links+'&amp;texts='+texts+'&amp;borderwidth='+width+'&amp;borderheight='+height+'&amp;textheight=0">';
				str += '<embed src="'+url+'" wmode="opaque" FlashVars="pics='+images+'&amp;links='+links+'&amp;texts='+texts+'&amp;borderwidth='+width+'&amp;borderheight='+height+'&amp;textheight=0" menu="false" bgcolor="#ffffff" quality="high" width="'+ width +'" height="'+ height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
				str += '</object>';
				document.write(str);
			}
			var focus_width=280;
			var focus_height=210;
			var text_height=0;
			var swf_height = focus_height+text_height;
			
			var pics='${eliteInfo.imgs}';
			
			var links='${eliteInfo.urls}';
			var texts='${eliteInfo.titles}';
			lovestory('story_flash','${ctx}/images/longtian/focus.swf',focus_width,swf_height,pics,links,texts);
   	  	</script>
	</td>
	<td width="10" valign="top"></td>
	<td width="440" valign="top">
	  <table width="440" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td height="25" align="left" style="border-bottom: 2px solid #FAA551;" colspan="2">
				&nbsp;<img src="${ctx}/images/longtian/icon_tt.gif"/>
            	&nbsp;<span style="font-size: 14px; font-weight: bold;">推荐内容</span>
            </td>
		</tr>
		<s:iterator value="eliteArticles" var="atr">
       	<tr onmouseover="this.style.backgroundColor='#F5F5F5'" onmouseout="this.style.backgroundColor='#ffffff'">
			<td width="360" height="25" style="border-bottom: 1px dashed #AAAAAA;">
			  <div class="title">&nbsp;&nbsp;
				<img src="${ctx}/images/icons/articleIco.gif">
				<a href="${ctx}/${atr.path}" target="_blank">${atr.title}</a>
			  </div>
			</td>
			<td width="80" style="border-bottom: 1px dashed #AAAAAA;" align="center">
				<s:date name="#atr.createTime" format="yyyy-MM-dd"/>
			</td>
		</tr>
		</s:iterator>
	  </table>
	</td>
	<td width="10" valign="top"></td>
	<td width="240" valign="top">
		<table width="240" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td height="25" align="left" style="border-bottom: 2px solid #FAA551;" >
					&nbsp;<img src="${ctx}/images/longtian/icon_tt.gif"/>
			    	&nbsp;<span style="font-size: 14px; font-weight: bold;"> 公 告</span>
				</td>
			</tr>
	        <tr>
				<td height="169">
					<div style="width:235px; padding-left: 5px; line-height: 20px;">
					  <marquee direction="up" scrollamount="2" height="150" onmouseover="this.stop();" onmouseout="this.start();">
	                    <s:iterator value="annArticles" var="ann">
	                      <li>&nbsp;<a href="${ctx}/${ann.path}" target="_blank">${ann.title}</a></li>
	                    </s:iterator>
	                  </marquee>
	                </div>
				</td>
	        </tr>
	      </table>
	</td>
</tr>
</table>
<br>
<table width="1000" align="center" height="31" cellpadding="0" cellspacing="0">
<tr>
  <td align="left" class="login_tt" style="border-bottom: 2px dotted #FAA551;">
   	&nbsp;
   	<a href="${ctx}/mainbook/index.do?bookType=2&currentPage=0" target="_self" title="查看更多新书">
   	<img src="${ctx}/images/longtian/icon_tt.gif" width="14" height="15"/>&nbsp;新&nbsp;书</a>
  </td>
</tr>
<tr>
  <td>
    <div style="width:1000px;">
      <s:iterator value="newBooks" var="book">
        <div class="books">
          <div class="bkphoto">
            <a href="${ctx}/book/view.do?model.id=${book.bkId}" target="_blank" title="${book.bkName}">
              <img width="100" height="130" src="${ctx}${book.bkPhoto}" onError="this.src='${ctx}/images/longtian/book_nophoto_big.gif'">
            </a>
          </div>
          <div class="bookinfo"><a href="${ctx}/book/view.do?model.id=${book.bkId}" target="_blank" title="${book.bkName}">${book.bkName}</a></div>
	      <div class="bookinfo" title="${book.author}">作者：${book.author}</div>
   	      <div class="bookinfo">价格：<span style="color:red">￥${book.price}</span>元</div>
   	      <div class="bookinfo">
   	      	<img src="${ctx}/images/longtian/but_buy.jpg"/>
	    	<img src="${ctx}/images/longtian/but_coll.jpg" border="0" onclick="addFavorite('${book.bkId}')" style="cursor: pointer;"/>
   	      </div>
	    </div>
      </s:iterator>
	</div>
  </td>
</tr>
</table>
<br>
<table width="1000" align="center" height="31" border="0" cellpadding="0" cellspacing="0">
<tr>
  <td align="left" class="login_tt" style="border-bottom: 2px dotted #FAA551;">
   	&nbsp;
   	<a href="${ctx}/mainbook/index.do?bookType=2&currentPage=0" target="_self" title="查看更多热销书">
   	<img src="${ctx}/images/longtian/icon_tt.gif" width="14" height="15"/>&nbsp;热销书</a>
  </td>
</tr>
<tr>
  <td>
    <div style="width:1000px;">
      <s:iterator value="hotBooks" var="book">
	    <div class="books">
	      <div class="bkphoto">
	        <a href="${ctx}/book/view.do?model.id=${book.bkId}" target="_blank" title="${book.bkName}">
	          <img width="100" height="130" src="${ctx}${book.bkPhoto}" onError="this.src='${ctx}/images/longtian/book_nophoto_big.gif'">
	        </a>
	      </div>
	      <div class="bookinfo">
	        <a href="${ctx}/book/view.do?model.id=${book.bkId}" target="_blank" title="${book.bkName}">${book.bkName}</a>
	      </div>
	      <div class="bookinfo" title="${book.author}">作者：${book.author}</div>
   	      <div class="bookinfo">价格：<span style="color:red">￥${book.price}</span>元</div>
   	      <div>
   	      	<img src="${ctx}/images/longtian/but_buy.jpg"/>
	    	<img src="${ctx}/images/longtian/but_coll.jpg" border="0" onclick="addFavorite('${book.bkId}')" style="cursor: pointer;"/>
   	      </div>
	    </div>
      </s:iterator>
    </div>
  </td>
</tr>
</table>
<br>
<table width="1000" align="center" height="31" border="0" cellpadding="0" cellspacing="0">
<tr>
  <td align="left" class="login_tt" style="border-bottom: 2px dotted #FAA551;">
   	&nbsp;
   	<a href="${ctx}/mainbook/index.do?bookType=3&currentPage=0" target="_self" title="查看更多特价书">
   	<img src="${ctx}/images/longtian/icon_tt.gif" width="14" height="15"/>&nbsp;特价书</a>
  </td>
</tr>
<tr>
  <td>
    <div style="width:1000px;">
     <s:iterator value="cheepBooks" var="book">
       <div class="books">
         <div class="bkphoto">
           <a href="${ctx}/book/view.do?model.id=${book.bkId}" target="_blank" title="${book.bkName}">
             <img width="100" height="130" src="${ctx}${book.bkPhoto}" onError="this.src='${ctx}/images/longtian/book_nophoto_big.gif'">
           </a>
         </div>
         <div class="bookinfo"><a href="${ctx}/book/view.do?model.id=${book.bkId}" target="_blank" title="${book.bkName}">${book.bkName}</a></div>
         <div class="bookinfo" title="${book.author}">作者：${book.author}</div>
         <div class="bookinfo">价格：<span style="color:red">￥${book.price}</span>元</div>
         <div>
   	      	<img src="${ctx}/images/longtian/but_buy.jpg"/>
	    	<img src="${ctx}/images/longtian/but_coll.jpg" border="0" onclick="addFavorite('${book.bkId}')" style="cursor: pointer;"/>
   	      </div>
       </div>
     </s:iterator>
    </div>
  </td>
</tr>
</table>
<br/>
<br/>
<%@include file="/pages/bottombar.jsp" %>
<script type="text/javascript">
//添加收藏
function addFavorite(bkId){
  $.ajax({
	url: '${ctx}/favorite/addFavorite.do',
	type: 'post',
	dataType: 'json',
	data: {bookId : bkId},
	success: function(rst, textStatus){
  		if(rst.result == "success"){
  		  alert("收藏成功");
  	  	}
  	  	if(rst.result == "added"){
  	  	  alert("已经收藏了该图书！");
  	  	}
  	  	if(rst.result == "error"){
  	  	  alert("您还没有登录，请登录！");
  	  	}
	}
  });
}

//站内搜索
function searchBook() {
	var schForm = document.getElementById("schForm");
	schForm.submit();
}
</script>
</body>
</html>
